

JAVA_ROOT ?= $(shell dirname $(shell dirname `which javac`))

INCLUDES := -I $(JAVA_ROOT)/include/
INCLUDES += -I $(JAVA_ROOT)/include/linux

SOURCES  := jni/JniObject.cpp
SOURCES  += jni/JniHelper.cpp
SOURCES  += jni/Test.cpp

all:
	-rm *.log -f
	g++ $(SOURCES) $(INCLUDES) -olibjni.so -shared -fPIC -Wall -Werror
	javac kaz/*.java

run:
	java -Djava.library.path=. kaz.Main

clean:
	rm libjni.so kaz/*.class *.log

